<template>
    <el-dialog title="特殊优惠" width="400px" :visible.sync="specialIsShow">
        <div class="add-box">
            <div class="mb-20">
                <span class="span">价格</span>
                <el-input style="flex:1;width:0" class="display-inline width100"
                          v-model="info.first_price" disabled></el-input>
            </div>
            <div>
                <span class="span">特殊优惠</span>
                <el-input style="flex:1;width:0" class="display-inline width100"
                          v-model="info.special"
                          placeholder="请填写"></el-input>
            </div>
        </div>
        <div slot="footer" class="dialog-footer">
            <el-button v-preventDbClick @click="specialIsShow=false">取 消</el-button>
            <el-button v-preventDbClick type="primary" @click="setSpecialPrice">确 定</el-button>
        </div>
    </el-dialog>
</template>

<script type="text/ecmascript-6">
import request from '../common/js/request.js';
import {tool} from "../common/js/tool";

export default {
    // props: ['fromData'],
    data() {
        return {
            specialIsShow: false,
            info: ''
        }
    },
    methods: {
        show(info) {
            this.info = info;
            this.specialIsShow = true;
        },
        setSpecialPrice() {
            request({
                url: '/manage/order/setSpecialPrice',
                data: {id: this.info.id, special: this.info.special}
            }).then((res) => {
                tool.message(res.msg, 'success', () => {
                    this.specialIsShow = false;
                    this.$emit('toData');
                })
            })
        },
    }
};
</script>

<style lang="less" rel="stylesheet/less" scoped>
.list {
    .item2 {
        border: 1px solid #ddd;
        margin: 0 10px 10px 0;
    }
}
</style>
